from django.contrib import admin
from rankings.models import Ranking, Persona

class PersonaInline(admin.TabularInline):
	model = Persona
	extra = 3

class RankingAdmin(admin.ModelAdmin):
    fieldsets = [
        (None,               {'fields': ['nombre']}),
        ('Informacion Fecha', {'fields': ['fecha_creacion'], 'classes': ['collapse']}),
    ]
    inlines = [PersonaInline]
    list_display = ('nombre' , 'fecha_creacion','is_long_name')
    list_filter = ['fecha_creacion']
    search_fields = ['nombre']
    date_hierarchy = 'fecha_creacion'

admin.site.register(Ranking, RankingAdmin)
admin.site.register(Persona)